Skip to main content

hour

Return a string with format: 10:15

Basic Usage#

const maskWizard = require("mask-wizard")
// [...]
function applyTimeMask(e) {
e.currentTarget.value = maskWizard.time.hour(e.currentTarget.value)
// the time() output in some value cases
// 1 OUTPUT 1
// 13 OUTPUT 13
// 130 OUTPUT 130
// 1300 OUTPUT 13:00
}
<input placeholder="Example" onChange={applyTimeMask} />

Parameters#

Parameter Nametyperequireddefaultdescription
hourInputstringyesnullstring to be masked
completebooleannofalseauto complete string to final format
symbolstringno':'symbol to be between hour and minutes

Live Example#